package me.sunpeng.Wildcard.demo3;


/**
 * @author sp
 */
public class Animal implements Comparable<Animal> {

    protected int age;

    public Animal(int age) {
        this.age = age;
    }


    @Override
    public int compareTo(Animal other) {
        return this.age - other.age;
    }
}

class Dog extends Animal {

    public Dog(int age) {
        super(age);
    }

}